<div id="content">
    <div class="row s_page_title">
        <sa-big-breadcrumbs [items]="['物料跟踪管理','基础信息维护','快递公司管理']" icon="fa-lg fa-fw fa fa-cubes" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
    </div>
    <sa-widgets-grid>
        <div class="s_table">
            <div sa-widget [editbutton]="false" color="darken" class="clearfix">
                <header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
                    <h2>快递公司管理</h2>
                </header>
                <div>
                    <div class="widget-body no-padding">
                        <div class="page-header clearfix s_table_opreation">
                            <div class="left page-header-btn">
                                <button type="button" class="btn btn-primary" (click)="newCompany(companyModal)">添加</button>
                            </div>
                            <div class="right top-search">
                                <input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="快递公司名称、快递公司编码">
                                <span class="top-search-box">
                                    <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
                                </span>
                            </div>
                        </div>
                        <div class="table_scroll">
                            <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                <thead>
                                    <tr>
                                        <th>公司名称</th>
                                        <th>公司编码</th>
                                        <th>是否常用公司</th>
                                        <th>创建时间</th>
                                        <th>更新时间</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr *ngFor="let row of tableData">
                                        <td>{{row.companyName}}</td>
                                        <td>{{row.companyCode}}</td>
                                        <td>{{row.isUsed?"是":"否"}}</td>
                                        <td>{{row.createTime}}</td>
                                        <td>{{row.updateTime}}</td>
                                        <td>
                                            <button type="button" (click)="editCompany(row,companyModal)">编辑</button>
                                            <button type="button" (click)="deleteCompany(row)">删除</button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="table-fix clearfix">
                            <paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
                            </paginator>
                            <button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </sa-widgets-grid>
</div>

<!-- 新增编辑用户类型   弹窗-->
<section bsModal #companyModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" (click)="companyClose(companyModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title"><span *ngIf="formType == 'new'">新增</span><span *ngIf="formType == 'update'">编辑</span>快递公司</h4>
            </div>
            <form id="companyForm" class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
                <div class="modal-body">
                    <div class="row form-horizontal">
                        <div class="form-group col-xs-12">
                            <label class="control-label col-sm-3 no-padding-right">公司名称<sup>*</sup></label>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" id="companyName" name="companyName" [(ngModel)]="companyForm.companyName" placeholder="公司名称" />
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="control-label col-sm-3 no-padding-right">公司编码</label>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" name='companyCode' id="companyCode" [(ngModel)]='companyForm.companyCode' placeholder="公司编码">
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="control-label col-sm-3 no-padding-right">是否常用公司<sup>*</sup></label>
                            <div class="col-sm-9">
                                <button class="isCommon" (click)="isUsedChange('1')" [ngClass]="companyForm.isUsed=='1'?'active':''">是</button>
                                <button class="isCommon" (click)="isUsedChange('0')" [ngClass]="companyForm.isUsed=='0'?'active':''">否</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" (click)="companyClose(companyModal)">取消</button>
                    <button type="button" class="btn btn-primary" (click)="companySubmit(companyModal)">确认</button>
                </div>
            </form>
        </div>
    </div>
</section>
<!-- 新增编辑用户类型 弹窗end-->